package com.xiaoming.stream;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

/**
 * @author xiaoming
 * @Date 2020/3/11
 * @blame xiaoming
 */
@Component
@Slf4j
public class RegisterEmailProducer {

    @Autowired
    private SendMessageInterface sendMessageInterface;

    public void sendMsg(String json){
        log.info("生产者发送内容msg：" + json);
        Message message = MessageBuilder.withPayload(json.getBytes()).build();
        sendMessageInterface.sendMsg().send(message);
    }
}
